package com.ws.base.db.common.order;

public final class Order {
    public Order() {
        this.isAsc = true;
    }

    public Order(boolean isAsc) {
        this.isAsc = isAsc;
    }

    public Order(boolean isAsc, String fieldName) {
        this.isAsc = isAsc;
        this.fieldName = fieldName;
    }

    public Order(String fieldName) {
        this.fieldName = fieldName;
    }

    private String fieldName;

    private boolean isAsc;

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public boolean isAsc() {
        return isAsc;
    }

    public void setAsc(boolean isAsc) {
        this.isAsc = isAsc;
    }

    public String getOrderStr() {
        return this.fieldName + " " + (isAsc ? "ASC" : "DESC");
    }

}
